home *** CD-ROM | disk | FTP | other *** search
/ All for Cell Phones: Sony Ericsson / Sony-Ericsson 2004.iso / Java / Chains / Chains.jar / Chains$SaveThread.class (.txt) < prev    next >
Encoding:
Java Class File  |  2002-08-14  |  1.9 KB  |  55 lines

  1. import javax.microedition.lcdui.Displayable;
  2. import javax.microedition.lcdui.Form;
  3. import javax.microedition.rms.RecordStore;
  4.  
  5. class Chains$SaveThread extends Thread {
  6.    // $FF: synthetic field
  7.    private final Chains this$0;
  8.  
  9.    private Chains$SaveThread(Chains var1) {
  10.       this.this$0 = var1;
  11.    }
  12.  
  13.    public void run() {
  14.       try {
  15.          Chains.progGauge.setValue(15);
  16.          RecordStore.deleteRecordStore("saveGame");
  17.       } catch (Exception var6) {
  18.       }
  19.  
  20.       try {
  21.          Chains.progGauge.setValue(30);
  22.          RecordStore var1 = RecordStore.openRecordStore("saveGame", true);
  23.          Chains.progGauge.setValue(45);
  24.          byte[] var7 = this.this$0.canvas.serialise();
  25.          Chains.progGauge.setValue(60);
  26.          var1.addRecord(var7, 0, var7.length);
  27.          Chains.progGauge.setValue(75);
  28.          var1.closeRecordStore();
  29.          Chains.progGauge.setValue(90);
  30.          this.this$0.form.addCommand(Chains.cont);
  31.       } catch (Exception var5) {
  32.          Form var2 = new Form("Phone Error");
  33.          var2.append("This game cannot be saved because the phone has run out of memory.");
  34.          ((Displayable)var2).addCommand(Chains.instQuit);
  35.          ((Displayable)var2).setCommandListener(Chains.access$0(this.this$0));
  36.          Chains.display.setCurrent(var2);
  37.  
  38.          try {
  39.             RecordStore.deleteRecordStore("saveGame");
  40.          } catch (Exception var4) {
  41.          }
  42.       }
  43.  
  44.       Chains.progGauge.setValue(100);
  45.       this.this$0.canvas.reset();
  46.       this.this$0.inGame = false;
  47.       Chains.display.setCurrent(this.this$0.form);
  48.    }
  49.  
  50.    // $FF: synthetic method
  51.    Chains$SaveThread(Chains var1, Chains$$1 var2) {
  52.       this(var1);
  53.    }
  54. }
  55.